package com.hsy.swu.roomdb

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.hsy.swu.home.grade.GradeModel

@Dao
interface GradeDao {
    @Insert
    fun insertAll(gradeList: List<GradeModel>)

    @Query("DELETE FROM GradeModel WHERE year = :year AND semester = :semester")
    fun deleteAllByYearAndSemester(year: String, semester: String)

    @Query("SELECT * FROM GradeModel WHERE year = :year AND semester = :semester")
    fun getAllByYearAndSemester(year: String, semester: String): List<GradeModel>

    @Query("DELETE FROM GradeModel")
    fun deleteAll()
}